package com.bz.xtcx.manager.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bz.xtcx.manager.entity.LibImage;
import com.bz.xtcx.manager.mapper.LibImageMapper;
import com.bz.xtcx.manager.service.ILibImageService;

@Service
public class LibImageService extends BaseService implements ILibImageService {

    @Autowired
    private LibImageMapper libImageMapper;
    
    @Override
    public int saveOrUpdate(LibImage e) {
        int result = 0;
        LibImage old = libImageMapper.findByLibId(e.getLibId());
        if(old != null) {
            old.setField1(e.getField1());
            old.setField2(e.getField2());
            old.setField3(e.getField3());
            old.setField4(e.getField4());
            old.setField5(e.getField5());
            old.setField6(e.getField6());
            old.setField7(e.getField7());
            old.setField8(e.getField8());
            old.setField9(e.getField9());
            old.setField10(e.getField10());
            old.setUpdater(e.getCreater());
            result = libImageMapper.update(old);
        }else {
            result = libImageMapper.insert(e);
        }
        return result;
    }

    @Override
    public LibImage getUserImage(String id) {
        // TODO Auto-generated method stub
        return null;
    }


    
}
